PCBFirst, you have to make a PCB board. You can make it by yourself using files attached at the end or you can buy ready to use JTAG PCB. Solder everything, external power supply socket is optional, use it only if you plan to connect JTAG to the external power source. ComponentsIt’s good practice to place ATMega16 and MAX232 into socket. Be sure that there aren’t any shortcuts and elements have proper values. Bill of materials
Soldering order1. M1 and M2 External powerJTAG can be powered from 2 sources: 1. Target board (that is debugged) via JTAG socket The first solution is most popular. External power is used only if your target board can not provide enough power for additional elements of JTAG board. For most users X2 socket is optional, you do not need to solder it. There’s a simple protection against improper power supply polarization – D1 diode. MAX232IC2 has to be MAX232A (with A at the end), that way small popular 0.1µF capacitors can be used. You can use standard MAX232 (more popular, cheaper and easy available), but remember to use 1.0µF capacitors (instead of 0.1µF). Programming ATmega16To perform this step you need an external programmer. Use programmer of your choice, any ISP or parallel programmer is suitable. Be sure the programmer software allows you to set fuse bits and program flash memory. If you have only ISP programmer, you can use any development board with ISP socket to program microcontroller. Replace original ATmega16 with the chip to be used in JTAG interface and program it in the usual way. After programming remove the chip. FlashDownload attached aquaticus_jtag_m16.hex file. This is a standard HEX file accepted by all programmers. It contains bootloader and original Atmel firmware. Put your ATmega16 into programmer and flash the chip using this file. Verify it and that’s all. Now it is time to program fuse bits. Fuse bitsThe most important fuses are:
The other settings does not really matter, but below you have description and values for all fuse bits.
NOTE: Do not set any lock bits. Now you can remove ATmega16 chip from programmer and put it into socket on JTAG PCB. Fuse screen shotsHere are the screen shots of the popular programs:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||




Size of flash
Hi!
I soldered the circuit myself and I tried to flash the HEX file. The file is 46 KB, but an ATMega16 has only 16 KB of flash!
Are you sure this is the correct binary?
File size should be OK,
File size should be OK, avr-size returns:
avr-size aquaticus_jtag_m16.hex
text data bss dec hex filename
0 16384 0 16384 4000 aquaticus_jtag_m16.hex
RE: File size should be OK
Surely it's OK :-) hex file size is always bigger then binady data.
PIN 16 on the max232 in not
PIN 16 on the max232 in not connected to anything in the schematic. Its Vcc. Should it not be connected to +5V.
Errata in the schematic!!
RE
Typically you do not draw power lines (VCC and GND) for IC on schematics because it's obvious you neeed to connect that lines. It's not an error but convention. Look at any other schematics and you never see VCC and GND connected except for some special solutions and very simple schematics.
in place of the 7.3728 MHz
in place of the 7.3728 MHz crystal can i use a 8 MHz crystal. If yes then what changes must i do in the hex file and also in the circuit.
RE: Crystal
Nope. You can't use 8MHz. It must be exact value! The value allows you to use 0% error serial communication (and it's not an easy task change hex file).
reg fuse bits
hello,
i was wondering if we have to necessarily set the fuse bits. i am using usbasp and cant put in fuse bits. it wold be helpful if you could suggest how i could overcome this issue.
RE
You [b]must[/b] program fuse bits.
Usbasp allows you to program fuses for sure. Just check options more carefully.
thanks man just found this
thanks man just found this http://khazama.com/project/programmer